cargo-features = ["strip"]

[package]
name = "whisperfish"
version = "0.6.0-dev"
authors = ["Ruben De Smet <ruben.de.smet@rubdos.be>"]
edition = "2018"
build = "build.rs"
license = "AGPL-3.0-or-later"
description = "Private messaging using Signal for SailfishOS -- library."

[dependencies]
actix = "0.13"
rand = "0.7"
uuid = { version = "=1.3.2", features=["v4"] }
mime = "0.3.17"
mime_guess = "2.0"
mime_classifier = "0.0.1"
chrono = "=0.4.25"
tokio = "=1.26.0"
futures = "0.3"
fs2 = "0.4.3"

# These require Rust >1.52
indexmap = "=1.8.1"
tokio-util = "=0.7.7"
flate2 = "=1.0.25"

blurhash = { git = "https://github.com/whisperfish/blurhash-rs.git", branch = "main" }
percent-encoding = "2.2"

# 3.0.0-rc.1 requires Rist 1.54
actix-http = "=3.0.0-beta.19"

libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", branch = "main" }
libsignal-service-actix = { git = "https://github.com/whisperfish/libsignal-service-rs", branch = "main" }

# These two are here *just* to enable the `whisperfork` feature flag through the `sailfish` feature gate.
# Cargo patch sections don't support these.
libsignal-protocol = { git = "https://github.com/signalapp/libsignal", tag = "v0.28.1" }
zkgroup = { git = "https://github.com/signalapp/libsignal", tag = "v0.28.1" }

proc-macro2 = "=1.0.43" # 1.0.44: unknown feature `proc_macro_span_shrink`
quote = "=1.0.23"

# Newer versions don't compile with Rust 1.52 (nightly-2021-05-06),
# which is what Sailfish SDK 3.9.3 (4.4.0.58) comes with
# Due to that, we need to pin the sha2 and sha-1 versions too.
pbkdf2 = { version = "=0.9.0", default-features = false }
hmac = "=0.11"
sha2 = "=0.9"
sha-1 = "=0.9"
aes = "0.7"
block-modes = "0.8"
once_cell = "=1.14.0"
rustls = "=0.20.6"

qttypes = "0.2.9"
qmetaobject = { version = "0.2.9" }
qmeta-async = { git = "https://gitlab.com/rubdos/qmeta-async.git" }
time = "=0.3.5"
scrypt = { version = "=0.8.1", default-features = false, features=["std"] }

getrandom = "0.2"

cpp = "0.5"
dirs = "4.0"
anyhow = "1.0"
thiserror = "1"
log = "=0.4.18"
hex = "0.4"
phonenumber = "=0.3.1"
itertools = "0.10.3"
qrcode = "0.12"
image = { version = "0.23", default-features = false, features=["png"] }

diesel = { version = "2.0", features = ["sqlite", "chrono"] }
diesel_migrations = "2.0"
libsqlite3-sys = { version = "0.25.2", features = ["sqlcipher"] }

serde = {version = "1.0", features = ["derive"]}

# Serde 0.8.26 requires Rust 1.56 (aka edition 2021)
serde_yaml = "=0.8.25"

base64 = "0.13"

tempfile = { version = "3.4.0", default-features = false }

secrecy = "0.7"

regex = "=1.7.3"

sailors = { git = "https://gitlab.com/whisperfish/sailo-rs.git", optional = true }
whisperfish-store = { path = "../whisperfish-store" }


[build-dependencies]
cmake = "=0.1.48"
cpp_build = "0.5"
cc = "1.0"
anyhow = "1.0"

[dev-dependencies]
actix-rt = "2.8.0"
# Git version for async tests. 0.6.5 will contain this feature,
# so revert to crates.io on release
criterion = "=0.3.5"
# 0.10 requires Rust 1.60
env_logger = "=0.9.3"
rstest = { version = "0.10" }
rstest_reuse = { version = "0.1.0" }

[features]
bundled-sqlcipher = ["libsqlite3-sys/bundled-sqlcipher", "whisperfish-store/bundled-sqlcipher"]
sailfish = ["bundled-sqlcipher", "sailors", "libsignal-protocol/whisperfork", "zkgroup/whisperfork", "whisperfish-store/sailfish"]
harbour = ["sailfish"]
